package cn.org.xwb.bookmall.model.vo;

import cn.org.xwb.bookmall.model.po.User;
import cn.org.xwb.bookmall.model.po.UserAllInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.Date;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class UserVo {

    private Long id;

    /**
     * 头像地址
     */
    private String avatar;

    /**
     * 头像背景地址
     */
    private String avatarBg;

    /**
     * 账号
     */
    private String account;

    /**
     * 用户名
     */
    private String username;

    /**
     * 邮箱
     */
    // private String mail;

    /**
     * 是否实名 0-未实名；1-实名
     */
    private Boolean realName;

    /**
     * 注册时间
     */
    private Date registerTime;

    public UserVo(User user) {
        this.id = user.getId();
        this.avatar = user.getAvatar();
        this.avatarBg = user.getAvatarBg();
        this.account = user.getAccount();
        this.username = user.getUsername();
        // this.mail = user.getMail();
        this.realName = user.getRealName();
        this.registerTime = user.getRegisterTime();
    }

    public UserVo(UserAllInfo user) {
        this.id = user.getId();
        this.avatar = user.getAvatar();
        this.avatarBg = user.getAvatarBg();
        this.account = user.getAccount();
        this.username = user.getUsername();
        // this.mail = user.getMail();
        this.realName = user.getRealName();
        this.registerTime = user.getRegisterTime();
    }

}
